﻿///////////////////////////////////////////////////////////////
// This is generated code. 
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 2.6
// Code is generated on: 02 November 2012 16:44:35
// Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20
// Templates vendor: Solutions Design.
// Templates version: 
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Collections;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Data;
using System.Xml.Serialization;
using NetDon.OA.Data;
using NetDon.OA.Data.FactoryClasses;
using NetDon.OA.Data.DaoClasses;
using NetDon.OA.Data.RelationClasses;
using NetDon.OA.Data.HelperClasses;
using NetDon.OA.Data.CollectionClasses;

using SD.LLBLGen.Pro.ORMSupportClasses;

namespace NetDon.OA.Data.EntityClasses
{
	
	// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
	// __LLBLGENPRO_USER_CODE_REGION_END

	/// <summary>
	/// Entity class which represents the entity 'IssuingOrderDelivery'. <br/><br/>
	/// 
	/// </summary>
	[Serializable]
	public partial class IssuingOrderDeliveryEntity : CommonEntityBase, ISerializable
		// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
		// __LLBLGENPRO_USER_CODE_REGION_END	
	{
		#region Class Member Declarations
		private NetDon.OA.Data.CollectionClasses.IssuingOrderReceiptInfoTrackCollection	_issuingOrderReceiptInfoTrack;
		private bool	_alwaysFetchIssuingOrderReceiptInfoTrack, _alreadyFetchedIssuingOrderReceiptInfoTrack;
		private NetDon.OA.Data.CollectionClasses.IssuingOrderCollection _issuingOrderCollectionViaIssuingOrderReceiptInfoTrack;
		private bool	_alwaysFetchIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack, _alreadyFetchedIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack;
		private IssuingOrderEntity _issuingOrder;
		private bool	_alwaysFetchIssuingOrder, _alreadyFetchedIssuingOrder, _issuingOrderReturnsNewIfNotFound;

		
		// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
		// __LLBLGENPRO_USER_CODE_REGION_END
		#endregion

		#region Statics
		private static Dictionary<string, string>	_customProperties;
		private static Dictionary<string, Dictionary<string, string>>	_fieldsCustomProperties;

		/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
		public static partial class MemberNames
		{
			/// <summary>Member name IssuingOrder</summary>
			public static readonly string IssuingOrder = "IssuingOrder";
			/// <summary>Member name IssuingOrderReceiptInfoTrack</summary>
			public static readonly string IssuingOrderReceiptInfoTrack = "IssuingOrderReceiptInfoTrack";
			/// <summary>Member name IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack</summary>
			public static readonly string IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack = "IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack";

		}
		#endregion
		
		/// <summary>Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed. </summary>
		static IssuingOrderDeliveryEntity()
		{
			SetupCustomPropertyHashtables();
		}

		/// <summary>CTor</summary>
		public IssuingOrderDeliveryEntity()
		{
			InitClassEmpty(null);
		}


		/// <summary>CTor</summary>
		/// <param name="id">PK value for IssuingOrderDelivery which data should be fetched into this IssuingOrderDelivery object</param>
		public IssuingOrderDeliveryEntity(System.Guid id)
		{
			InitClassFetch(id, null, null);
		}

		/// <summary>CTor</summary>
		/// <param name="id">PK value for IssuingOrderDelivery which data should be fetched into this IssuingOrderDelivery object</param>
		/// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch as well</param>
		public IssuingOrderDeliveryEntity(System.Guid id, IPrefetchPath prefetchPathToUse)
		{
			InitClassFetch(id, null, prefetchPathToUse);
		}

		/// <summary>CTor</summary>
		/// <param name="id">PK value for IssuingOrderDelivery which data should be fetched into this IssuingOrderDelivery object</param>
		/// <param name="validator">The custom validator object for this IssuingOrderDeliveryEntity</param>
		public IssuingOrderDeliveryEntity(System.Guid id, IValidator validator)
		{
			InitClassFetch(id, validator, null);
		}


		/// <summary>Private CTor for deserialization</summary>
		/// <param name="info"></param>
		/// <param name="context"></param>
		protected IssuingOrderDeliveryEntity(SerializationInfo info, StreamingContext context) : base(info, context)
		{
			_issuingOrderReceiptInfoTrack = (NetDon.OA.Data.CollectionClasses.IssuingOrderReceiptInfoTrackCollection)info.GetValue("_issuingOrderReceiptInfoTrack", typeof(NetDon.OA.Data.CollectionClasses.IssuingOrderReceiptInfoTrackCollection));
			_alwaysFetchIssuingOrderReceiptInfoTrack = info.GetBoolean("_alwaysFetchIssuingOrderReceiptInfoTrack");
			_alreadyFetchedIssuingOrderReceiptInfoTrack = info.GetBoolean("_alreadyFetchedIssuingOrderReceiptInfoTrack");
			_issuingOrderCollectionViaIssuingOrderReceiptInfoTrack = (NetDon.OA.Data.CollectionClasses.IssuingOrderCollection)info.GetValue("_issuingOrderCollectionViaIssuingOrderReceiptInfoTrack", typeof(NetDon.OA.Data.CollectionClasses.IssuingOrderCollection));
			_alwaysFetchIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack = info.GetBoolean("_alwaysFetchIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack");
			_alreadyFetchedIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack = info.GetBoolean("_alreadyFetchedIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack");
			_issuingOrder = (IssuingOrderEntity)info.GetValue("_issuingOrder", typeof(IssuingOrderEntity));
			if(_issuingOrder!=null)
			{
				_issuingOrder.AfterSave+=new EventHandler(OnEntityAfterSave);
			}
			_issuingOrderReturnsNewIfNotFound = info.GetBoolean("_issuingOrderReturnsNewIfNotFound");
			_alwaysFetchIssuingOrder = info.GetBoolean("_alwaysFetchIssuingOrder");
			_alreadyFetchedIssuingOrder = info.GetBoolean("_alreadyFetchedIssuingOrder");

			base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance(), PersistenceInfoProviderSingleton.GetInstance());
			
			// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
			// __LLBLGENPRO_USER_CODE_REGION_END
		}

		
		/// <summary>Performs the desync setup when an FK field has been changed. The entity referenced based on the FK field will be dereferenced and sync info will be removed.</summary>
		/// <param name="fieldIndex">The fieldindex.</param>
		protected override void PerformDesyncSetupFKFieldChange(int fieldIndex)
		{
			switch((IssuingOrderDeliveryFieldIndex)fieldIndex)
			{
				case IssuingOrderDeliveryFieldIndex.IssuingOrderId:
					DesetupSyncIssuingOrder(true, false);
					_alreadyFetchedIssuingOrder = false;
					break;
				default:
					base.PerformDesyncSetupFKFieldChange(fieldIndex);
					break;
			}
		}
		
		/// <summary>Gets the inheritance info provider instance of the project this entity instance is located in. </summary>
		/// <returns>ready to use inheritance info provider instance.</returns>
		protected override IInheritanceInfoProvider GetInheritanceInfoProvider()
		{
			return InheritanceInfoProviderSingleton.GetInstance();
		}
		
		/// <summary> Will perform post-ReadXml actions</summary>
		protected override void PostReadXmlFixups()
		{
			_alreadyFetchedIssuingOrderReceiptInfoTrack = (_issuingOrderReceiptInfoTrack.Count > 0);
			_alreadyFetchedIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack = (_issuingOrderCollectionViaIssuingOrderReceiptInfoTrack.Count > 0);
			_alreadyFetchedIssuingOrder = (_issuingOrder != null);

		}
				
		/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
		/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
		/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
		public override RelationCollection GetRelationsForFieldOfType(string fieldName)
		{
			return IssuingOrderDeliveryEntity.GetRelationsForField(fieldName);
		}

		/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
		/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
		/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
		public static RelationCollection GetRelationsForField(string fieldName)
		{
			RelationCollection toReturn = new RelationCollection();
			switch(fieldName)
			{
				case "IssuingOrder":
					toReturn.Add(IssuingOrderDeliveryEntity.Relations.IssuingOrderEntityUsingIssuingOrderId);
					break;
				case "IssuingOrderReceiptInfoTrack":
					toReturn.Add(IssuingOrderDeliveryEntity.Relations.IssuingOrderReceiptInfoTrackEntityUsingIssuingOrderDeliveryId);
					break;
				case "IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack":
					toReturn.Add(IssuingOrderDeliveryEntity.Relations.IssuingOrderReceiptInfoTrackEntityUsingIssuingOrderDeliveryId, "IssuingOrderDeliveryEntity__", "IssuingOrderReceiptInfoTrack_", JoinHint.None);
					toReturn.Add(IssuingOrderReceiptInfoTrackEntity.Relations.IssuingOrderEntityUsingIssuingOrderId, "IssuingOrderReceiptInfoTrack_", string.Empty, JoinHint.None);
					break;

				default:

					break;				
			}
			return toReturn;
		}



		/// <summary> ISerializable member. Does custom serialization so event handlers do not get serialized.
		/// Serializes members of this entity class and uses the base class' implementation to serialize the rest.</summary>
		/// <param name="info"></param>
		/// <param name="context"></param>
		[EditorBrowsable(EditorBrowsableState.Never)]
		public override void GetObjectData(SerializationInfo info, StreamingContext context)
		{
			info.AddValue("_issuingOrderReceiptInfoTrack", (!this.MarkedForDeletion?_issuingOrderReceiptInfoTrack:null));
			info.AddValue("_alwaysFetchIssuingOrderReceiptInfoTrack", _alwaysFetchIssuingOrderReceiptInfoTrack);
			info.AddValue("_alreadyFetchedIssuingOrderReceiptInfoTrack", _alreadyFetchedIssuingOrderReceiptInfoTrack);
			info.AddValue("_issuingOrderCollectionViaIssuingOrderReceiptInfoTrack", (!this.MarkedForDeletion?_issuingOrderCollectionViaIssuingOrderReceiptInfoTrack:null));
			info.AddValue("_alwaysFetchIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack", _alwaysFetchIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack);
			info.AddValue("_alreadyFetchedIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack", _alreadyFetchedIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack);
			info.AddValue("_issuingOrder", (!this.MarkedForDeletion?_issuingOrder:null));
			info.AddValue("_issuingOrderReturnsNewIfNotFound", _issuingOrderReturnsNewIfNotFound);
			info.AddValue("_alwaysFetchIssuingOrder", _alwaysFetchIssuingOrder);
			info.AddValue("_alreadyFetchedIssuingOrder", _alreadyFetchedIssuingOrder);

			
			// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
			// __LLBLGENPRO_USER_CODE_REGION_END
			base.GetObjectData(info, context);
		}
		
		/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary>
		/// <param name="propertyName">Name of the property.</param>
		/// <param name="entity">Entity to set as an related entity</param>
		/// <remarks>Used by prefetch path logic.</remarks>
		[EditorBrowsable(EditorBrowsableState.Never)]
		public override void SetRelatedEntityProperty(string propertyName, IEntity entity)
		{
			switch(propertyName)
			{
				case "IssuingOrder":
					_alreadyFetchedIssuingOrder = true;
					this.IssuingOrder = (IssuingOrderEntity)entity;
					break;
				case "IssuingOrderReceiptInfoTrack":
					_alreadyFetchedIssuingOrderReceiptInfoTrack = true;
					if(entity!=null)
					{
						this.IssuingOrderReceiptInfoTrack.Add((IssuingOrderReceiptInfoTrackEntity)entity);
					}
					break;
				case "IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack":
					_alreadyFetchedIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack = true;
					if(entity!=null)
					{
						this.IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack.Add((IssuingOrderEntity)entity);
					}
					break;

				default:

					break;
			}
		}

		/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary>
		/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
		/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
		[EditorBrowsable(EditorBrowsableState.Never)]
		public override void SetRelatedEntity(IEntity relatedEntity, string fieldName)
		{
			switch(fieldName)
			{
				case "IssuingOrder":
					SetupSyncIssuingOrder(relatedEntity);
					break;
				case "IssuingOrderReceiptInfoTrack":
					_issuingOrderReceiptInfoTrack.Add((IssuingOrderReceiptInfoTrackEntity)relatedEntity);
					break;

				default:

					break;
			}
		}
		
		/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary>
		/// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param>
		/// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param>
		/// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param>
		[EditorBrowsable(EditorBrowsableState.Never)]
		public override void UnsetRelatedEntity(IEntity relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
		{
			switch(fieldName)
			{
				case "IssuingOrder":
					DesetupSyncIssuingOrder(false, true);
					break;
				case "IssuingOrderReceiptInfoTrack":
					base.PerformRelatedEntityRemoval(_issuingOrderReceiptInfoTrack, relatedEntity, signalRelatedEntityManyToOne);
					break;

				default:

					break;
			}
		}

		/// <summary> Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These
		/// entities will have to be persisted after this entity during a recursive save.</summary>
		/// <returns>Collection with 0 or more IEntity objects, referenced by this entity</returns>
		public override List<IEntity> GetDependingRelatedEntities()
		{
			List<IEntity> toReturn = new List<IEntity>();


			return toReturn;
		}
		
		/// <summary> Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
		/// entities will have to be persisted before this entity during a recursive save.</summary>
		/// <returns>Collection with 0 or more IEntity objects, referenced by this entity</returns>
		public override List<IEntity> GetDependentRelatedEntities()
		{
			List<IEntity> toReturn = new List<IEntity>();
			if(_issuingOrder!=null)
			{
				toReturn.Add(_issuingOrder);
			}


			return toReturn;
		}
		
		/// <summary> Gets a List of all entity collections stored as member variables in this entity. The contents of the ArrayList is
		/// used by the DataAccessAdapter to perform recursive saves. Only 1:n related collections are returned.</summary>
		/// <returns>Collection with 0 or more IEntityCollection objects, referenced by this entity</returns>
		public override List<IEntityCollection> GetMemberEntityCollections()
		{
			List<IEntityCollection> toReturn = new List<IEntityCollection>();
			toReturn.Add(_issuingOrderReceiptInfoTrack);

			return toReturn;
		}

		

		

		/// <summary> Fetches the contents of this entity from the persistent storage using the primary key.</summary>
		/// <param name="id">PK value for IssuingOrderDelivery which data should be fetched into this IssuingOrderDelivery object</param>
		/// <returns>True if succeeded, false otherwise.</returns>
		public bool FetchUsingPK(System.Guid id)
		{
			return FetchUsingPK(id, null, null, null);
		}

		/// <summary> Fetches the contents of this entity from the persistent storage using the primary key.</summary>
		/// <param name="id">PK value for IssuingOrderDelivery which data should be fetched into this IssuingOrderDelivery object</param>
		/// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch as well</param>
		/// <returns>True if succeeded, false otherwise.</returns>
		public bool FetchUsingPK(System.Guid id, IPrefetchPath prefetchPathToUse)
		{
			return FetchUsingPK(id, prefetchPathToUse, null, null);
		}

		/// <summary> Fetches the contents of this entity from the persistent storage using the primary key.</summary>
		/// <param name="id">PK value for IssuingOrderDelivery which data should be fetched into this IssuingOrderDelivery object</param>
		/// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch as well</param>
		/// <param name="contextToUse">The context to add the entity to if the fetch was succesful. </param>
		/// <returns>True if succeeded, false otherwise.</returns>
		public bool FetchUsingPK(System.Guid id, IPrefetchPath prefetchPathToUse, Context contextToUse)
		{
			return Fetch(id, prefetchPathToUse, contextToUse, null);
		}

		/// <summary> Fetches the contents of this entity from the persistent storage using the primary key.</summary>
		/// <param name="id">PK value for IssuingOrderDelivery which data should be fetched into this IssuingOrderDelivery object</param>
		/// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch as well</param>
		/// <param name="contextToUse">The context to add the entity to if the fetch was succesful. </param>
		/// <param name="excludedIncludedFields">The list of IEntityField objects which have to be excluded or included for the fetch. 
		/// If null or empty, all fields are fetched (default). If an instance of ExcludeIncludeFieldsList is passed in and its ExcludeContainedFields property
		/// is set to false, the fields contained in excludedIncludedFields are kept in the query, the rest of the fields in the query are excluded.</param>
		/// <returns>True if succeeded, false otherwise.</returns>
		public bool FetchUsingPK(System.Guid id, IPrefetchPath prefetchPathToUse, Context contextToUse, ExcludeIncludeFieldsList excludedIncludedFields)
		{
			return Fetch(id, prefetchPathToUse, contextToUse, excludedIncludedFields);
		}

		/// <summary> Refetches the Entity from the persistent storage. Refetch is used to re-load an Entity which is marked "Out-of-sync", due to a save action. 
		/// Refetching an empty Entity has no effect. </summary>
		/// <returns>true if Refetch succeeded, false otherwise</returns>
		public override bool Refetch()
		{
			return Fetch(this.Id, null, null, null);
		}

		/// <summary> Returns true if the original value for the field with the fieldIndex passed in, read from the persistent storage was NULL, false otherwise.
		/// Should not be used for testing if the current value is NULL, use <see cref="TestCurrentFieldValueForNull"/> for that.</summary>
		/// <param name="fieldIndex">Index of the field to test if that field was NULL in the persistent storage</param>
		/// <returns>true if the field with the passed in index was NULL in the persistent storage, false otherwise</returns>
		public bool TestOriginalFieldValueForNull(IssuingOrderDeliveryFieldIndex fieldIndex)
		{
			return base.Fields[(int)fieldIndex].IsNull;
		}
		
		/// <summary>Returns true if the current value for the field with the fieldIndex passed in represents null/not defined, false otherwise.
		/// Should not be used for testing if the original value (read from the db) is NULL</summary>
		/// <param name="fieldIndex">Index of the field to test if its currentvalue is null/undefined</param>
		/// <returns>true if the field's value isn't defined yet, false otherwise</returns>
		public bool TestCurrentFieldValueForNull(IssuingOrderDeliveryFieldIndex fieldIndex)
		{
			return base.CheckIfCurrentFieldValueIsNull((int)fieldIndex);
		}

				
		/// <summary>Gets a list of all the EntityRelation objects the type of this instance has.</summary>
		/// <returns>A list of all the EntityRelation objects the type of this instance has. Hierarchy relations are excluded.</returns>
		public override List<IEntityRelation> GetAllRelations()
		{
			return new IssuingOrderDeliveryRelations().GetAllRelations();
		}


		/// <summary> Retrieves all related entities of type 'IssuingOrderReceiptInfoTrackEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <returns>Filled collection with all related entities of type 'IssuingOrderReceiptInfoTrackEntity'</returns>
		public NetDon.OA.Data.CollectionClasses.IssuingOrderReceiptInfoTrackCollection GetMultiIssuingOrderReceiptInfoTrack(bool forceFetch)
		{
			return GetMultiIssuingOrderReceiptInfoTrack(forceFetch, _issuingOrderReceiptInfoTrack.EntityFactoryToUse, null);
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderReceiptInfoTrackEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="filter">Extra filter to limit the resultset.</param>
		/// <returns>Filled collection with all related entities of type 'IssuingOrderReceiptInfoTrackEntity'</returns>
		public NetDon.OA.Data.CollectionClasses.IssuingOrderReceiptInfoTrackCollection GetMultiIssuingOrderReceiptInfoTrack(bool forceFetch, IPredicateExpression filter)
		{
			return GetMultiIssuingOrderReceiptInfoTrack(forceFetch, _issuingOrderReceiptInfoTrack.EntityFactoryToUse, filter);
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderReceiptInfoTrackEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
		/// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
		public NetDon.OA.Data.CollectionClasses.IssuingOrderReceiptInfoTrackCollection GetMultiIssuingOrderReceiptInfoTrack(bool forceFetch, IEntityFactory entityFactoryToUse)
		{
			return GetMultiIssuingOrderReceiptInfoTrack(forceFetch, entityFactoryToUse, null);
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderReceiptInfoTrackEntity' using a relation of type '1:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
		/// <param name="filter">Extra filter to limit the resultset.</param>
		/// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
		public virtual NetDon.OA.Data.CollectionClasses.IssuingOrderReceiptInfoTrackCollection GetMultiIssuingOrderReceiptInfoTrack(bool forceFetch, IEntityFactory entityFactoryToUse, IPredicateExpression filter)
		{
 			if( ( !_alreadyFetchedIssuingOrderReceiptInfoTrack || forceFetch || _alwaysFetchIssuingOrderReceiptInfoTrack) && !base.IsSerializing && !base.IsDeserializing && !base.InDesignMode)
			{
				if(base.ParticipatesInTransaction)
				{
					if(!_issuingOrderReceiptInfoTrack.ParticipatesInTransaction)
					{
						base.Transaction.Add(_issuingOrderReceiptInfoTrack);
					}
				}
				_issuingOrderReceiptInfoTrack.SuppressClearInGetMulti=!forceFetch;
				if(entityFactoryToUse!=null)
				{
					_issuingOrderReceiptInfoTrack.EntityFactoryToUse = entityFactoryToUse;
				}
				_issuingOrderReceiptInfoTrack.GetMultiManyToOne(null, this, filter);
				_issuingOrderReceiptInfoTrack.SuppressClearInGetMulti=false;
				_alreadyFetchedIssuingOrderReceiptInfoTrack = true;
			}
			return _issuingOrderReceiptInfoTrack;
		}

		/// <summary> Sets the collection parameters for the collection for 'IssuingOrderReceiptInfoTrack'. These settings will be taken into account
		/// when the property IssuingOrderReceiptInfoTrack is requested or GetMultiIssuingOrderReceiptInfoTrack is called.</summary>
		/// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return. When set to 0, this parameter is ignored</param>
		/// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified (null), no sorting is applied.</param>
		public virtual void SetCollectionParametersIssuingOrderReceiptInfoTrack(long maxNumberOfItemsToReturn, ISortExpression sortClauses)
		{
			_issuingOrderReceiptInfoTrack.SortClauses=sortClauses;
			_issuingOrderReceiptInfoTrack.MaxNumberOfItemsToReturn=maxNumberOfItemsToReturn;
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderEntity' using a relation of type 'm:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <returns>Filled collection with all related entities of type 'IssuingOrderEntity'</returns>
		public NetDon.OA.Data.CollectionClasses.IssuingOrderCollection GetMultiIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack(bool forceFetch)
		{
			return GetMultiIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack(forceFetch, _issuingOrderCollectionViaIssuingOrderReceiptInfoTrack.EntityFactoryToUse);
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderEntity' using a relation of type 'm:n'.</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
		/// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToMany() routine.</param>
		/// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
		public NetDon.OA.Data.CollectionClasses.IssuingOrderCollection GetMultiIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack(bool forceFetch, IEntityFactory entityFactoryToUse)
		{
 			if( ( !_alreadyFetchedIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack || forceFetch || _alwaysFetchIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack) && !base.IsSerializing && !base.IsDeserializing && !base.InDesignMode)
			{
				if(base.ParticipatesInTransaction)
				{
					if(!_issuingOrderCollectionViaIssuingOrderReceiptInfoTrack.ParticipatesInTransaction)
					{
						base.Transaction.Add(_issuingOrderCollectionViaIssuingOrderReceiptInfoTrack);
					}
				}
				IPredicateExpression filter = new PredicateExpression();
				filter.Add(new FieldCompareValuePredicate(IssuingOrderDeliveryFields.Id, ComparisonOperator.Equal, this.Id, "IssuingOrderDeliveryEntity__"));
				_issuingOrderCollectionViaIssuingOrderReceiptInfoTrack.SuppressClearInGetMulti=!forceFetch;
				if(entityFactoryToUse!=null)
				{
					_issuingOrderCollectionViaIssuingOrderReceiptInfoTrack.EntityFactoryToUse = entityFactoryToUse;
				}
				_issuingOrderCollectionViaIssuingOrderReceiptInfoTrack.GetMulti(filter, GetRelationsForField("IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack"));
				_issuingOrderCollectionViaIssuingOrderReceiptInfoTrack.SuppressClearInGetMulti=false;
				_alreadyFetchedIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack = true;
			}
			return _issuingOrderCollectionViaIssuingOrderReceiptInfoTrack;
		}

		/// <summary> Sets the collection parameters for the collection for 'IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack'. These settings will be taken into account
		/// when the property IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack is requested or GetMultiIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack is called.</summary>
		/// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return. When set to 0, this parameter is ignored</param>
		/// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified (null), no sorting is applied.</param>
		public virtual void SetCollectionParametersIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack(long maxNumberOfItemsToReturn, ISortExpression sortClauses)
		{
			_issuingOrderCollectionViaIssuingOrderReceiptInfoTrack.SortClauses=sortClauses;
			_issuingOrderCollectionViaIssuingOrderReceiptInfoTrack.MaxNumberOfItemsToReturn=maxNumberOfItemsToReturn;
		}

		/// <summary> Retrieves the related entity of type 'IssuingOrderEntity', using a relation of type 'n:1'</summary>
		/// <returns>A fetched entity of type 'IssuingOrderEntity' which is related to this entity.</returns>
		public IssuingOrderEntity GetSingleIssuingOrder()
		{
			return GetSingleIssuingOrder(false);
		}

		/// <summary> Retrieves the related entity of type 'IssuingOrderEntity', using a relation of type 'n:1'</summary>
		/// <param name="forceFetch">if true, it will discard any changes currently in the currently loaded related entity and will refetch the entity from the persistent storage</param>
		/// <returns>A fetched entity of type 'IssuingOrderEntity' which is related to this entity.</returns>
		public virtual IssuingOrderEntity GetSingleIssuingOrder(bool forceFetch)
		{
			if( ( !_alreadyFetchedIssuingOrder || forceFetch || _alwaysFetchIssuingOrder) && !base.IsSerializing && !base.IsDeserializing  && !base.InDesignMode)			
			{
				bool performLazyLoading = base.CheckIfLazyLoadingShouldOccur(IssuingOrderDeliveryEntity.Relations.IssuingOrderEntityUsingIssuingOrderId);

				IssuingOrderEntity newEntity = new IssuingOrderEntity();
				if(base.ParticipatesInTransaction)
				{
					base.Transaction.Add(newEntity);
				}
				bool fetchResult = false;
				if(performLazyLoading)
				{
					fetchResult = newEntity.FetchUsingPK(this.IssuingOrderId);
				}
				if(fetchResult)
				{
					if(base.ActiveContext!=null)
					{
						newEntity = (IssuingOrderEntity)base.ActiveContext.Get(newEntity);
					}
					this.IssuingOrder = newEntity;
				}
				else
				{
					if(_issuingOrderReturnsNewIfNotFound)
					{
						if(performLazyLoading || (!performLazyLoading && (_issuingOrder == null)))
						{
							this.IssuingOrder = newEntity;
						}
					}
					else
					{
						this.IssuingOrder = null;
					}
				}
				_alreadyFetchedIssuingOrder = fetchResult;
				if(base.ParticipatesInTransaction && !fetchResult)
				{
					base.Transaction.Remove(newEntity);
				}
			}
			return _issuingOrder;
		}


		/// <summary> Performs the insert action of a new Entity to the persistent storage.</summary>
		/// <returns>true if succeeded, false otherwise</returns>
		protected override bool InsertEntity()
		{
			IssuingOrderDeliveryDAO dao = (IssuingOrderDeliveryDAO)CreateDAOInstance();
			return dao.AddNew(base.Fields, base.Transaction);
		}
		
		/// <summary> Adds the internals to the active context. </summary>
		protected override void AddInternalsToContext()
		{
			_issuingOrderReceiptInfoTrack.ActiveContext = base.ActiveContext;
			_issuingOrderCollectionViaIssuingOrderReceiptInfoTrack.ActiveContext = base.ActiveContext;
			if(_issuingOrder!=null)
			{
				_issuingOrder.ActiveContext = base.ActiveContext;
			}


		}


		/// <summary> Performs the update action of an existing Entity to the persistent storage.</summary>
		/// <returns>true if succeeded, false otherwise</returns>
		protected override bool UpdateEntity()
		{
			IssuingOrderDeliveryDAO dao = (IssuingOrderDeliveryDAO)CreateDAOInstance();
			return dao.UpdateExisting(base.Fields, base.Transaction);
		}
		
		/// <summary> Performs the update action of an existing Entity to the persistent storage.</summary>
		/// <param name="updateRestriction">Predicate expression, meant for concurrency checks in an Update query</param>
		/// <returns>true if succeeded, false otherwise</returns>
		protected override bool UpdateEntity(IPredicate updateRestriction)
		{
			IssuingOrderDeliveryDAO dao = (IssuingOrderDeliveryDAO)CreateDAOInstance();
			return dao.UpdateExisting(base.Fields, base.Transaction, updateRestriction);
		}
	
		/// <summary> Initializes the class with empty data, as if it is a new Entity.</summary>
		/// <param name="validatorToUse">Validator to use.</param>
		protected virtual void InitClassEmpty(IValidator validatorToUse)
		{
			OnInitializing();
			base.Fields = CreateFields();
			base.IsNew=true;
			base.Validator = validatorToUse;

			InitClassMembers();
			
			// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
			// __LLBLGENPRO_USER_CODE_REGION_END

			OnInitialized();
		}
		
		/// <summary>Creates entity fields object for this entity. Used in constructor to setup this entity in a polymorphic scenario.</summary>
		protected virtual IEntityFields CreateFields()
		{
			return EntityFieldsFactory.CreateEntityFieldsObject(NetDon.OA.Data.EntityType.IssuingOrderDeliveryEntity);
		}
		
		/// <summary>Creates a new transaction object</summary>
		/// <param name="levelOfIsolation">The level of isolation.</param>
		/// <param name="name">The name.</param>
		protected override ITransaction CreateTransaction( IsolationLevel levelOfIsolation, string name )
		{
			return new Transaction(levelOfIsolation, name);
		}

		/// <summary>
		/// Creates the ITypeDefaultValue instance used to provide default values for value types which aren't of type nullable(of T)
		/// </summary>
		/// <returns></returns>
		protected override ITypeDefaultValue CreateTypeDefaultValueProvider()
		{
			return new TypeDefaultValue();
		}

		/// <summary>
		/// Gets all related data objects, stored by name. The name is the field name mapped onto the relation for that particular data element. 
		/// </summary>
		/// <returns>Dictionary with per name the related referenced data element, which can be an entity collection or an entity or null</returns>
		public override Dictionary<string, object> GetRelatedData()
		{
			Dictionary<string, object> toReturn = new Dictionary<string, object>();
			toReturn.Add("IssuingOrder", _issuingOrder);
			toReturn.Add("IssuingOrderReceiptInfoTrack", _issuingOrderReceiptInfoTrack);
			toReturn.Add("IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack", _issuingOrderCollectionViaIssuingOrderReceiptInfoTrack);

			return toReturn;
		}
		

		/// <summary> Initializes the the entity and fetches the data related to the entity in this entity.</summary>
		/// <param name="id">PK value for IssuingOrderDelivery which data should be fetched into this IssuingOrderDelivery object</param>
		/// <param name="validator">The validator object for this IssuingOrderDeliveryEntity</param>
		/// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch as well</param>
		protected virtual void InitClassFetch(System.Guid id, IValidator validator, IPrefetchPath prefetchPathToUse)
		{
			OnInitializing();
			base.Validator = validator;
			InitClassMembers();
			base.Fields = CreateFields();
			bool wasSuccesful = Fetch(id, prefetchPathToUse, null, null);
			base.IsNew = !wasSuccesful;

			
			// __LLBLGENPRO_USER_CODE_REGION_START InitClassFetch
			// __LLBLGENPRO_USER_CODE_REGION_END

			OnInitialized();
		}

		/// <summary> Initializes the class members</summary>
		private void InitClassMembers()
		{
			_issuingOrderReceiptInfoTrack = new NetDon.OA.Data.CollectionClasses.IssuingOrderReceiptInfoTrackCollection(new IssuingOrderReceiptInfoTrackEntityFactory());
			_issuingOrderReceiptInfoTrack.SetContainingEntityInfo(this, "IssuingOrderDelivery");
			_alwaysFetchIssuingOrderReceiptInfoTrack = false;
			_alreadyFetchedIssuingOrderReceiptInfoTrack = false;
			_issuingOrderCollectionViaIssuingOrderReceiptInfoTrack = new NetDon.OA.Data.CollectionClasses.IssuingOrderCollection(new IssuingOrderEntityFactory());
			_alwaysFetchIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack = false;
			_alreadyFetchedIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack = false;
			_issuingOrder = null;
			_issuingOrderReturnsNewIfNotFound = true;
			_alwaysFetchIssuingOrder = false;
			_alreadyFetchedIssuingOrder = false;


			PerformDependencyInjection();
			
			// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
			// __LLBLGENPRO_USER_CODE_REGION_END
			OnInitClassMembersComplete();
		}

		#region Custom Property Hashtable Setup
		/// <summary> Initializes the hashtables for the entity type and entity field custom properties. </summary>
		private static void SetupCustomPropertyHashtables()
		{
			_customProperties = new Dictionary<string, string>();
			_fieldsCustomProperties = new Dictionary<string, Dictionary<string, string>>();

			Dictionary<string, string> fieldHashtable = null;
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("Id", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("IssuingOrderId", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("DeliveryOrderCode", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("CreatedDate", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("LastUpdatedDate", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("CreateBy", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("LastUpdatedBy", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("AreaId", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("Remark", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("DeliveryOrderType", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("DeliveryAddress", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("DeliveryCity", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("UnitCost", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("OrderVolumn", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("OrderWeight", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("OrderQuantity", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("ActualEntruckingOrderVolumn", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("ActualEntruckingOrderWeight", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("ActualEntruckingOrderQuantity", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("RevenueUnitCost", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("GoodsUnloadingPriceRatio", fieldHashtable);
			fieldHashtable = new Dictionary<string, string>();

			_fieldsCustomProperties.Add("ConvertedOrderVolumnWeight", fieldHashtable);
		}
		#endregion


		/// <summary> Removes the sync logic for member _issuingOrder</summary>
		/// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param>
		/// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param>
		private void DesetupSyncIssuingOrder(bool signalRelatedEntity, bool resetFKFields)
		{
			base.PerformDesetupSyncRelatedEntity( _issuingOrder, new PropertyChangedEventHandler( OnIssuingOrderPropertyChanged ), "IssuingOrder", IssuingOrderDeliveryEntity.Relations.IssuingOrderEntityUsingIssuingOrderId, true, signalRelatedEntity, "IssuingOrderDelivery", resetFKFields, new int[] { (int)IssuingOrderDeliveryFieldIndex.IssuingOrderId } );		
			_issuingOrder = null;
		}
		
		/// <summary> setups the sync logic for member _issuingOrder</summary>
		/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
		private void SetupSyncIssuingOrder(IEntity relatedEntity)
		{
			if(_issuingOrder!=relatedEntity)
			{		
				DesetupSyncIssuingOrder(true, true);
				_issuingOrder = (IssuingOrderEntity)relatedEntity;
				base.PerformSetupSyncRelatedEntity( _issuingOrder, new PropertyChangedEventHandler( OnIssuingOrderPropertyChanged ), "IssuingOrder", IssuingOrderDeliveryEntity.Relations.IssuingOrderEntityUsingIssuingOrderId, true, ref _alreadyFetchedIssuingOrder, new string[] {  } );
			}
		}

		/// <summary>Handles property change events of properties in a related entity.</summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void OnIssuingOrderPropertyChanged( object sender, PropertyChangedEventArgs e )
		{
			switch( e.PropertyName )
			{
				default:
					break;
			}
		}


		/// <summary> Fetches the entity from the persistent storage. Fetch simply reads the entity into an EntityFields object. </summary>
		/// <param name="id">PK value for IssuingOrderDelivery which data should be fetched into this IssuingOrderDelivery object</param>
		/// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch as well</param>
		/// <param name="contextToUse">The context to add the entity to if the fetch was succesful. </param>
		/// <param name="excludedIncludedFields">The list of IEntityField objects which have to be excluded or included for the fetch. 
		/// If null or empty, all fields are fetched (default). If an instance of ExcludeIncludeFieldsList is passed in and its ExcludeContainedFields property
		/// is set to false, the fields contained in excludedIncludedFields are kept in the query, the rest of the fields in the query are excluded.</param>
		/// <returns>True if succeeded, false otherwise.</returns>
		private bool Fetch(System.Guid id, IPrefetchPath prefetchPathToUse, Context contextToUse, ExcludeIncludeFieldsList excludedIncludedFields)
		{
			try
			{
				OnFetch();
				IDao dao = this.CreateDAOInstance();
				base.Fields[(int)IssuingOrderDeliveryFieldIndex.Id].ForcedCurrentValueWrite(id);
				dao.FetchExisting(this, base.Transaction, prefetchPathToUse, contextToUse, excludedIncludedFields);
				return (base.Fields.State == EntityState.Fetched);
			}
			finally
			{
				OnFetchComplete();
			}
		}


		/// <summary> Creates the DAO instance for this type</summary>
		/// <returns></returns>
		protected override IDao CreateDAOInstance()
		{
			return DAOFactory.CreateIssuingOrderDeliveryDAO();
		}
		
		/// <summary> Creates the entity factory for this type.</summary>
		/// <returns></returns>
		protected override IEntityFactory CreateEntityFactory()
		{
			return new IssuingOrderDeliveryEntityFactory();
		}

		#region Class Property Declarations
		/// <summary> The relations object holding all relations of this entity with other entity classes.</summary>
		public  static IssuingOrderDeliveryRelations Relations
		{
			get	{ return new IssuingOrderDeliveryRelations(); }
		}
		
		/// <summary> The custom properties for this entity type.</summary>
		/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
		public  static Dictionary<string, string> CustomProperties
		{
			get { return _customProperties;}
		}


		/// <summary> Creates a new PrefetchPathElement object which contains all the information to prefetch the related entities of type 'IssuingOrderReceiptInfoTrack' 
		/// for this entity. Add the object returned by this property to an existing PrefetchPath instance.</summary>
		/// <returns>Ready to use IPrefetchPathElement implementation.</returns>
		public static IPrefetchPathElement PrefetchPathIssuingOrderReceiptInfoTrack
		{
			get
			{
				return new PrefetchPathElement(new NetDon.OA.Data.CollectionClasses.IssuingOrderReceiptInfoTrackCollection(),
					(IEntityRelation)GetRelationsForField("IssuingOrderReceiptInfoTrack")[0], (int)NetDon.OA.Data.EntityType.IssuingOrderDeliveryEntity, (int)NetDon.OA.Data.EntityType.IssuingOrderReceiptInfoTrackEntity, 0, null, null, null, "IssuingOrderReceiptInfoTrack", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany);
			}
		}

		/// <summary> Creates a new PrefetchPathElement object which contains all the information to prefetch the related entities of type 'IssuingOrder' 
		/// for this entity. Add the object returned by this property to an existing PrefetchPath instance.</summary>
		/// <returns>Ready to use IPrefetchPathElement implementation.</returns>
		public static IPrefetchPathElement PrefetchPathIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack
		{
			get
			{
				IEntityRelation intermediateRelation = IssuingOrderDeliveryEntity.Relations.IssuingOrderReceiptInfoTrackEntityUsingIssuingOrderDeliveryId;
				intermediateRelation.SetAliases(string.Empty, "IssuingOrderReceiptInfoTrack_");
				return new PrefetchPathElement(new NetDon.OA.Data.CollectionClasses.IssuingOrderCollection(), intermediateRelation,
					(int)NetDon.OA.Data.EntityType.IssuingOrderDeliveryEntity, (int)NetDon.OA.Data.EntityType.IssuingOrderEntity, 0, null, null, GetRelationsForField("IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack"), "IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToMany);
			}
		}

		/// <summary> Creates a new PrefetchPathElement object which contains all the information to prefetch the related entities of type 'IssuingOrder' 
		/// for this entity. Add the object returned by this property to an existing PrefetchPath instance.</summary>
		/// <returns>Ready to use IPrefetchPathElement implementation.</returns>
		public static IPrefetchPathElement PrefetchPathIssuingOrder
		{
			get
			{
				return new PrefetchPathElement(new NetDon.OA.Data.CollectionClasses.IssuingOrderCollection(),
					(IEntityRelation)GetRelationsForField("IssuingOrder")[0], (int)NetDon.OA.Data.EntityType.IssuingOrderDeliveryEntity, (int)NetDon.OA.Data.EntityType.IssuingOrderEntity, 0, null, null, null, "IssuingOrder", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne);
			}
		}


		/// <summary>Returns the full name for this entity, which is important for the DAO to find back persistence info for this entity.</summary>
		[Browsable(false), XmlIgnore]
		public override string LLBLGenProEntityName
		{
			get { return "IssuingOrderDeliveryEntity";}
		}

		/// <summary> The custom properties for the type of this entity instance.</summary>
		/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
		[Browsable(false), XmlIgnore]
		public override Dictionary<string, string> CustomPropertiesOfType
		{
			get { return IssuingOrderDeliveryEntity.CustomProperties;}
		}

		/// <summary> The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
		/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
		public  static Dictionary<string, Dictionary<string, string>> FieldsCustomProperties
		{
			get { return _fieldsCustomProperties;}
		}

		/// <summary> The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs. </summary>
		/// <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
		[Browsable(false), XmlIgnore]
		public override Dictionary<string, Dictionary<string, string>> FieldsCustomPropertiesOfType
		{
			get { return IssuingOrderDeliveryEntity.FieldsCustomProperties;}
		}

		/// <summary> The Id property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."Id"<br/>
		/// Table field type characteristics (type, precision, scale, length): UniqueIdentifier, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
		public virtual System.Guid Id
		{
			get { return (System.Guid)GetValue((int)IssuingOrderDeliveryFieldIndex.Id, true); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.Id, value, true); }
		}
		/// <summary> The IssuingOrderId property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."IssuingOrderId"<br/>
		/// Table field type characteristics (type, precision, scale, length): UniqueIdentifier, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.Guid IssuingOrderId
		{
			get { return (System.Guid)GetValue((int)IssuingOrderDeliveryFieldIndex.IssuingOrderId, true); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.IssuingOrderId, value, true); }
		}
		/// <summary> The DeliveryOrderCode property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."DeliveryOrderCode"<br/>
		/// Table field type characteristics (type, precision, scale, length): NVarChar, 0, 0, 50<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.String DeliveryOrderCode
		{
			get { return (System.String)GetValue((int)IssuingOrderDeliveryFieldIndex.DeliveryOrderCode, true); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.DeliveryOrderCode, value, true); }
		}
		/// <summary> The CreatedDate property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."CreatedDate"<br/>
		/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.DateTime> CreatedDate
		{
			get { return (Nullable<System.DateTime>)GetValue((int)IssuingOrderDeliveryFieldIndex.CreatedDate, false); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.CreatedDate, value, true); }
		}
		/// <summary> The LastUpdatedDate property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."LastUpdatedDate"<br/>
		/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.DateTime> LastUpdatedDate
		{
			get { return (Nullable<System.DateTime>)GetValue((int)IssuingOrderDeliveryFieldIndex.LastUpdatedDate, false); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.LastUpdatedDate, value, true); }
		}
		/// <summary> The CreateBy property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."CreateBy"<br/>
		/// Table field type characteristics (type, precision, scale, length): UniqueIdentifier, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Guid> CreateBy
		{
			get { return (Nullable<System.Guid>)GetValue((int)IssuingOrderDeliveryFieldIndex.CreateBy, false); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.CreateBy, value, true); }
		}
		/// <summary> The LastUpdatedBy property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."LastUpdatedBy"<br/>
		/// Table field type characteristics (type, precision, scale, length): UniqueIdentifier, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Guid> LastUpdatedBy
		{
			get { return (Nullable<System.Guid>)GetValue((int)IssuingOrderDeliveryFieldIndex.LastUpdatedBy, false); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.LastUpdatedBy, value, true); }
		}
		/// <summary> The AreaId property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."AreaId"<br/>
		/// Table field type characteristics (type, precision, scale, length): UniqueIdentifier, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
		public virtual System.Guid AreaId
		{
			get { return (System.Guid)GetValue((int)IssuingOrderDeliveryFieldIndex.AreaId, true); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.AreaId, value, true); }
		}
		/// <summary> The Remark property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."Remark"<br/>
		/// Table field type characteristics (type, precision, scale, length): NVarChar, 0, 0, 2147483647<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual System.String Remark
		{
			get { return (System.String)GetValue((int)IssuingOrderDeliveryFieldIndex.Remark, true); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.Remark, value, true); }
		}
		/// <summary> The DeliveryOrderType property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."DeliveryOrderType"<br/>
		/// Table field type characteristics (type, precision, scale, length): UniqueIdentifier, 0, 0, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Guid> DeliveryOrderType
		{
			get { return (Nullable<System.Guid>)GetValue((int)IssuingOrderDeliveryFieldIndex.DeliveryOrderType, false); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.DeliveryOrderType, value, true); }
		}
		/// <summary> The DeliveryAddress property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."DeliveryAddress"<br/>
		/// Table field type characteristics (type, precision, scale, length): NVarChar, 0, 0, 250<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual System.String DeliveryAddress
		{
			get { return (System.String)GetValue((int)IssuingOrderDeliveryFieldIndex.DeliveryAddress, true); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.DeliveryAddress, value, true); }
		}
		/// <summary> The DeliveryCity property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."DeliveryCity"<br/>
		/// Table field type characteristics (type, precision, scale, length): NVarChar, 0, 0, 6<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual System.String DeliveryCity
		{
			get { return (System.String)GetValue((int)IssuingOrderDeliveryFieldIndex.DeliveryCity, true); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.DeliveryCity, value, true); }
		}
		/// <summary> The UnitCost property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."UnitCost"<br/>
		/// Table field type characteristics (type, precision, scale, length): Decimal, 18, 5, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Decimal> UnitCost
		{
			get { return (Nullable<System.Decimal>)GetValue((int)IssuingOrderDeliveryFieldIndex.UnitCost, false); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.UnitCost, value, true); }
		}
		/// <summary> The OrderVolumn property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."OrderVolumn"<br/>
		/// Table field type characteristics (type, precision, scale, length): Decimal, 18, 5, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Decimal> OrderVolumn
		{
			get { return (Nullable<System.Decimal>)GetValue((int)IssuingOrderDeliveryFieldIndex.OrderVolumn, false); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.OrderVolumn, value, true); }
		}
		/// <summary> The OrderWeight property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."OrderWeight"<br/>
		/// Table field type characteristics (type, precision, scale, length): Decimal, 18, 5, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Decimal> OrderWeight
		{
			get { return (Nullable<System.Decimal>)GetValue((int)IssuingOrderDeliveryFieldIndex.OrderWeight, false); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.OrderWeight, value, true); }
		}
		/// <summary> The OrderQuantity property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."OrderQuantity"<br/>
		/// Table field type characteristics (type, precision, scale, length): Decimal, 18, 5, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Decimal> OrderQuantity
		{
			get { return (Nullable<System.Decimal>)GetValue((int)IssuingOrderDeliveryFieldIndex.OrderQuantity, false); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.OrderQuantity, value, true); }
		}
		/// <summary> The ActualEntruckingOrderVolumn property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."ActualEntruckingOrderVolumn"<br/>
		/// Table field type characteristics (type, precision, scale, length): Decimal, 18, 5, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Decimal> ActualEntruckingOrderVolumn
		{
			get { return (Nullable<System.Decimal>)GetValue((int)IssuingOrderDeliveryFieldIndex.ActualEntruckingOrderVolumn, false); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.ActualEntruckingOrderVolumn, value, true); }
		}
		/// <summary> The ActualEntruckingOrderWeight property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."ActualEntruckingOrderWeight"<br/>
		/// Table field type characteristics (type, precision, scale, length): Decimal, 18, 5, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Decimal> ActualEntruckingOrderWeight
		{
			get { return (Nullable<System.Decimal>)GetValue((int)IssuingOrderDeliveryFieldIndex.ActualEntruckingOrderWeight, false); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.ActualEntruckingOrderWeight, value, true); }
		}
		/// <summary> The ActualEntruckingOrderQuantity property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."ActualEntruckingOrderQuantity"<br/>
		/// Table field type characteristics (type, precision, scale, length): Decimal, 18, 5, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Decimal> ActualEntruckingOrderQuantity
		{
			get { return (Nullable<System.Decimal>)GetValue((int)IssuingOrderDeliveryFieldIndex.ActualEntruckingOrderQuantity, false); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.ActualEntruckingOrderQuantity, value, true); }
		}
		/// <summary> The RevenueUnitCost property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."RevenueUnitCost"<br/>
		/// Table field type characteristics (type, precision, scale, length): Decimal, 18, 5, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Decimal> RevenueUnitCost
		{
			get { return (Nullable<System.Decimal>)GetValue((int)IssuingOrderDeliveryFieldIndex.RevenueUnitCost, false); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.RevenueUnitCost, value, true); }
		}
		/// <summary> The GoodsUnloadingPriceRatio property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."GoodsUnloadingPriceRatio"<br/>
		/// Table field type characteristics (type, precision, scale, length): Decimal, 18, 5, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Decimal> GoodsUnloadingPriceRatio
		{
			get { return (Nullable<System.Decimal>)GetValue((int)IssuingOrderDeliveryFieldIndex.GoodsUnloadingPriceRatio, false); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.GoodsUnloadingPriceRatio, value, true); }
		}
		/// <summary> The ConvertedOrderVolumnWeight property of the Entity IssuingOrderDelivery<br/><br/>
		/// </summary>
		/// <remarks>Mapped on  table field: "IssuingOrderDelivery"."ConvertedOrderVolumnWeight"<br/>
		/// Table field type characteristics (type, precision, scale, length): Decimal, 18, 5, 0<br/>
		/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
		public virtual Nullable<System.Decimal> ConvertedOrderVolumnWeight
		{
			get { return (Nullable<System.Decimal>)GetValue((int)IssuingOrderDeliveryFieldIndex.ConvertedOrderVolumnWeight, false); }
			set	{ SetValue((int)IssuingOrderDeliveryFieldIndex.ConvertedOrderVolumnWeight, value, true); }
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderReceiptInfoTrackEntity' using a relation of type '1:n'.</summary>
		/// <remarks>This property is added for databinding conveniance, however it is recommeded to use the method 'GetMultiIssuingOrderReceiptInfoTrack()', because 
		/// this property is rather expensive and a method tells the user to cache the result when it has to be used more than once in the same scope.</remarks>
		public virtual NetDon.OA.Data.CollectionClasses.IssuingOrderReceiptInfoTrackCollection IssuingOrderReceiptInfoTrack
		{
			get	{ return GetMultiIssuingOrderReceiptInfoTrack(false); }
		}

		/// <summary> Gets / sets the lazy loading flag for IssuingOrderReceiptInfoTrack. When set to true, IssuingOrderReceiptInfoTrack is always refetched from the 
		/// persistent storage. When set to false, the data is only fetched the first time IssuingOrderReceiptInfoTrack is accessed. You can always execute
		/// a forced fetch by calling GetMultiIssuingOrderReceiptInfoTrack(true).</summary>
		[Browsable(false)]
		public bool AlwaysFetchIssuingOrderReceiptInfoTrack
		{
			get	{ return _alwaysFetchIssuingOrderReceiptInfoTrack; }
			set	{ _alwaysFetchIssuingOrderReceiptInfoTrack = value; }	
		}		
				
		/// <summary>Gets / Sets the lazy loading flag if the property IssuingOrderReceiptInfoTrack already has been fetched. Setting this property to false when IssuingOrderReceiptInfoTrack has been fetched
		/// will clear the IssuingOrderReceiptInfoTrack collection well. Setting this property to true while IssuingOrderReceiptInfoTrack hasn't been fetched disables lazy loading for IssuingOrderReceiptInfoTrack</summary>
		[Browsable(false)]
		public bool AlreadyFetchedIssuingOrderReceiptInfoTrack
		{
			get { return _alreadyFetchedIssuingOrderReceiptInfoTrack;}
			set 
			{
				if(_alreadyFetchedIssuingOrderReceiptInfoTrack && !value && (_issuingOrderReceiptInfoTrack != null))
				{
					_issuingOrderReceiptInfoTrack.Clear();
				}
				_alreadyFetchedIssuingOrderReceiptInfoTrack = value;
			}
		}

		/// <summary> Retrieves all related entities of type 'IssuingOrderEntity' using a relation of type 'm:n'.</summary>
		/// <remarks>This property is added for databinding conveniance, however it is recommeded to use the method 'GetMultiIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack()', because 
		/// this property is rather expensive and a method tells the user to cache the result when it has to be used more than once in the same scope.</remarks>
		public virtual NetDon.OA.Data.CollectionClasses.IssuingOrderCollection IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack
		{
			get { return GetMultiIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack(false); }
		}

		/// <summary> Gets / sets the lazy loading flag for IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack. When set to true, IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack is always refetched from the 
		/// persistent storage. When set to false, the data is only fetched the first time IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack is accessed. You can always execute
		/// a forced fetch by calling GetMultiIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack(true).</summary>
		[Browsable(false)]
		public bool AlwaysFetchIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack
		{
			get	{ return _alwaysFetchIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack; }
			set	{ _alwaysFetchIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack = value; }
		}
				
		/// <summary>Gets / Sets the lazy loading flag if the property IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack already has been fetched. Setting this property to false when IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack has been fetched
		/// will clear the IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack collection well. Setting this property to true while IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack hasn't been fetched disables lazy loading for IssuingOrderCollectionViaIssuingOrderReceiptInfoTrack</summary>
		[Browsable(false)]
		public bool AlreadyFetchedIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack
		{
			get { return _alreadyFetchedIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack;}
			set 
			{
				if(_alreadyFetchedIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack && !value && (_issuingOrderCollectionViaIssuingOrderReceiptInfoTrack != null))
				{
					_issuingOrderCollectionViaIssuingOrderReceiptInfoTrack.Clear();
				}
				_alreadyFetchedIssuingOrderCollectionViaIssuingOrderReceiptInfoTrack = value;
			}
		}

		/// <summary> Gets / sets related entity of type 'IssuingOrderEntity'. This property is not visible in databound grids.
		/// Setting this property to a new object will make the load-on-demand feature to stop fetching data from the database, until you set this
		/// property to null. Setting this property to an entity will make sure that FK-PK relations are synchronized when appropriate.</summary>
		/// <remarks>This property is added for conveniance, however it is recommeded to use the method 'GetSingleIssuingOrder()', because 
		/// this property is rather expensive and a method tells the user to cache the result when it has to be used more than once in the
		/// same scope. The property is marked non-browsable to make it hidden in bound controls, f.e. datagrids.</remarks>
		[Browsable(false)]
		public virtual IssuingOrderEntity IssuingOrder
		{
			get	{ return GetSingleIssuingOrder(false); }
			set
			{
				if(base.IsDeserializing)
				{
					SetupSyncIssuingOrder(value);
				}
				else
				{
					if(value==null)
					{
						if(_issuingOrder != null)
						{
							_issuingOrder.UnsetRelatedEntity(this, "IssuingOrderDelivery");
						}
					}
					else
					{
						if(_issuingOrder!=value)
						{
							((IEntity)value).SetRelatedEntity(this, "IssuingOrderDelivery");
						}
					}
				}
			}
		}

		/// <summary> Gets / sets the lazy loading flag for IssuingOrder. When set to true, IssuingOrder is always refetched from the 
		/// persistent storage. When set to false, the data is only fetched the first time IssuingOrder is accessed. You can always execute
		/// a forced fetch by calling GetSingleIssuingOrder(true).</summary>
		[Browsable(false)]
		public bool AlwaysFetchIssuingOrder
		{
			get	{ return _alwaysFetchIssuingOrder; }
			set	{ _alwaysFetchIssuingOrder = value; }	
		}
				
		/// <summary>Gets / Sets the lazy loading flag if the property IssuingOrder already has been fetched. Setting this property to false when IssuingOrder has been fetched
		/// will set IssuingOrder to null as well. Setting this property to true while IssuingOrder hasn't been fetched disables lazy loading for IssuingOrder</summary>
		[Browsable(false)]
		public bool AlreadyFetchedIssuingOrder
		{
			get { return _alreadyFetchedIssuingOrder;}
			set 
			{
				if(_alreadyFetchedIssuingOrder && !value)
				{
					this.IssuingOrder = null;
				}
				_alreadyFetchedIssuingOrder = value;
			}
		}

		/// <summary> Gets / sets the flag for what to do if the related entity available through the property IssuingOrder is not found
		/// in the database. When set to true, IssuingOrder will return a new entity instance if the related entity is not found, otherwise 
		/// null be returned if the related entity is not found. Default: true.</summary>
		[Browsable(false)]
		public bool IssuingOrderReturnsNewIfNotFound
		{
			get	{ return _issuingOrderReturnsNewIfNotFound; }
			set { _issuingOrderReturnsNewIfNotFound = value; }	
		}



		/// <summary> Gets or sets a value indicating whether this entity is a subtype</summary>
		protected override bool LLBLGenProIsSubType
		{
			get { return false;}
		}

		/// <summary> Gets the type of the hierarchy this entity is in. </summary>
		[System.ComponentModel.Browsable(false), XmlIgnore]
		protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
		{
			get { return InheritanceHierarchyType.None;}
		}
		
		/// <summary>Returns the NetDon.OA.Data.EntityType enum value for this entity.</summary>
		[Browsable(false), XmlIgnore]
		public override int LLBLGenProEntityTypeValue 
		{ 
			get { return (int)NetDon.OA.Data.EntityType.IssuingOrderDeliveryEntity; }
		}
		#endregion


		#region Custom Entity code
		
		// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
		// __LLBLGENPRO_USER_CODE_REGION_END
		#endregion

		#region Included code

		#endregion
	}
}
